//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.cloud.logger.zchain.spring.config;

import com.cloud.logger.zchain.core.zookeeper.DefaultConnectionStateListener;
import com.cloud.logger.zchain.core.zookeeper.ZookeeperFactory;
import com.cloud.logger.zchain.support.ScheduleAnnotaion;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.annotation.Order;

@Configuration
@Order(3)
/*@PropertySource(
        value = {"classpath:zoo.propertis"},
        encoding = "utf-8"
)*/
public class SchedulingConfig {
    //@Value("${zookeeper.address}")
    private String zooAddr ="115.159.160.97:2181";

    public SchedulingConfig() {
    }

    @Bean
    public ZookeeperFactory zookeeperFactory() throws Exception {
        ZookeeperFactory zookeeperFactory = ZookeeperFactory.getInstance();
        zookeeperFactory.init(this.zooAddr, "zchain-client", 5000);
        return zookeeperFactory;
    }

    @Bean
    public DefaultConnectionStateListener defaultConnectionStateListener() {
        return new DefaultConnectionStateListener();
    }

    @Bean
    public ScheduleAnnotaion scheduleAnnotaion() {
        return new ScheduleAnnotaion();
    }
}
